#include "ThreadPool.hpp"
#include <iostream>
#include <unistd.h>
int main()
{
    ThreadPool<std::function<void()>>::GetInstance();
    int i = 0;
    while (true)
    {
        if (i == 10)
        {
            break;
        }
        ThreadPool<std::function<void()>>::GetInstance()->Enqueue([i]
                                                                  { std::cout << std::to_string(i) << std::endl; });
        i++;
        sleep(1);
    }
    ThreadPool<std::function<void()>>::GetInstance()->Exit();
    ThreadPool<std::function<void()>>::GetInstance()->WaitAll();

    return 0;
}